<?php
/**
 * Description of 
 *
 * @author Marco Mounzer
 * @email m.mounzer@gmail.com
 * @copyright 2013
 */
require_once '../lib/begin.php';

if (!isset($_SESSION['user']) || get_class($_SESSION['user']) != 'WebUser')
    header('location: /');

require_once 'WebPhoto.php';

$obj = new WebPhoto();

if (isset($_POST['_delete'])) {
    $obj = Database::GetIstance()->loadObject($obj, $_REQUEST['id']);
    if ($obj->delete()) {
        echo "<br /><br />Elemento eliminato";
        return;
    }
}